#ifndef _RESOLVER
#define _RESOLVER

#include "hv.h"
#include "EventLoop.h"
#include "Buffer.h"

using namespace hv;


class Resovler{
public:
    static void resolvePacket(EventLoopPtr& loop ,Buffer* buffer){
        loop->runInLoop([&]{ //添加事件/工作（定义回调函数），resolver接收包
            printf("Resovler in tid %ld -- " ,hv_gettid());
            printf("Receive Packet len:%zd \n",buffer->len);

            loop->runInLoop([&]{ //添加事件（定义回调函数），交给router处理
                printf("Router in tid %ld -- " ,hv_gettid());
                printf("Router acknowledged\n\n");
            });
        });
    }
};
#endif